<%@ page import="activity.Event" %>
<div class="panel-group" id="accordion">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h4 class="panel-title">
                <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">基本資訊</a>
            </h4>
        </div>
        <div id="collapseOne" class="panel-collapse collapse in">
            <div class="panel-body">

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'serial', 'error')} required">
                    <label for="serial">
                        <g:message code="event.serial.label" default="Serial" />
                        <span class="required-indicator">*</span>
                    </label>
                        <g:select id="serial" name="serial.id" from="${activity.Serial.list()}" optionKey="id" required="" value="${eventInstance?.serial?.id}" class="many-to-one" noSelection="${['':'']}"/>
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'kind', 'error')} required">
                    <label for="kind">
                        <g:message code="event.kind.label" default="Kind" />
                        <span class="required-indicator">*</span>
                    </label>
                    <g:select id="kind" name="kind.id" from="${code.Kind.list()}" optionKey="id" required="" value="${eventInstance?.kind?.id}" class="many-to-one"/>
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'name', 'error')} required">
                    <label for="name">
                        <g:message code="event.name.label" default="Name" />
                        <span class="required-indicator">*</span>
                    </label>
                    <g:textField name="name" required="" value="${eventInstance?.name}" size="40" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'audience', 'error')} required">
                    <label for="audience">
                        <g:message code="event.audience.label" default="Audience" />
                        <span class="required-indicator">*</span>
                    </label>
                    <g:textField name="audience" required="" value="${eventInstance?.audience}" size="40" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'dateStart', 'error')} ">
                    <label for="dateStart">
                        <g:message code="event.dateStart.label" default="Date Start" />

                    </label>
                    <g:datePicker name="dateStart" precision="minute"  value="${eventInstance?.dateStart}" default="none" noSelection="['': '']" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'dateEnd', 'error')} ">
                    <label for="dateEnd">
                        <g:message code="event.dateEnd.label" default="Date End" />

                    </label>
                    <g:datePicker name="dateEnd" precision="minute"  value="${eventInstance?.dateEnd}" default="none" noSelection="['': '']" />
                </div>


                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'place', 'error')} required">
                    <label for="place">
                        <g:message code="event.place.label" default="Place" />
                    <span class="required-indicator">*</span>
                    </label>
                        <g:select id="place" name="place.id" from="${code.Place.list()}" optionKey="id" required="" value="${eventInstance?.place?.id}" class="many-to-one" noSelection="${['':'']}"/>
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'intro', 'error')} ">
                    <label for="intro">
                        <g:message code="event.intro.label" default="Intro" />
                    </label>
                    <m:ckeditor name="intro" value="${eventInstance?.intro}"/>
                </div>

                    <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'cohost', 'error')} ">
                        <label for="cohost">
                            <g:message code="event.cohost.label" default="Cohost" />

                        </label>
                            <g:textField name="cohost" value="${eventInstance?.cohost}" size="40" />
                    </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'partner', 'error')} ">
                    <label for="partner">
                        <g:message code="event.partner.label" default="Partner" />

                    </label>
                    <g:textField name="partner" value="${eventInstance?.partner}" size="40" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'files', 'error')} ">
                    <label for="files">
                        <g:message code="event.files.label" default="Files" />

                    </label>
                    <input type="file" name="file" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'memo', 'error')} ">
                    <label for="memo">
                        <g:message code="event.memo.label" default="Memo" />

                    </label>
                    <g:textField name="memo" value="${eventInstance?.memo}" size="40" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'custom1', 'error')} ">
                    <label for="custom1">
                        <g:message code="event.custom1.label" default="Custom1" />

                    </label>
                    <g:textField name="custom1" value="${eventInstance?.custom1}" size="40" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'custom2', 'error')} ">
                    <label for="custom2">
                        <g:message code="event.custom2.label" default="Custom2" />

                    </label>
                    <g:textField name="custom2" value="${eventInstance?.custom2}" size="40" />
                </div>



                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'regFee', 'error')} ">
                    <label for="regFee">
                        <g:message code="event.regFee.label" default="Reg Fee" />

                    </label>
                    <g:field name="regFee" type="number" value="${eventInstance.regFee}"/>
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'capacityQty', 'error')} ">
                    <label for="capacityQty">
                        <g:message code="event.capacityQty.label" default="Capacity Qty" />

                    </label>
                    <g:field name="capacityQty" type="number" value="${eventInstance.capacityQty}"/>
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'standbyQty', 'error')} ">
                    <label for="standbyQty">
                        <g:message code="event.standbyQty.label" default="Standby Qty" />

                    </label>
                    <g:field name="standbyQty" type="number" value="${eventInstance.standbyQty}"/>
                </div>

                <g:if test="${false}">
                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'registerQty', 'error')} ">
                    <label for="registerQty">
                        <g:message code="event.registerQty.label" default="Register Qty" />

                    </label>
                    <g:field name="registerQty" type="number" value="${eventInstance.registerQty}"/>
                </div>
                </g:if>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'checkInQty', 'error')} ">
                    <label for="checkInQty">
                        <g:message code="event.checkInQty.label" default="Check In Qty" />

                    </label>
                    <g:field name="checkInQty" type="number" value="${eventInstance.checkInQty}"/>
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'registerHigh', 'error')} ">
                    <label for="registerHigh">
                        <g:message code="event.registerHigh.label" default="Register High" />

                    </label>
                    <g:field name="registerHigh" type="number" value="${eventInstance.registerHigh}"/>
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'registerLow', 'error')} ">
                    <label for="registerLow">
                        <g:message code="event.registerLow.label" default="Register Low" />

                    </label>
                    <g:field name="registerLow" type="number" value="${eventInstance.registerLow}"/>
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'regStart', 'error')} ">
                    <label for="regStart">
                        <g:message code="event.regStart.label" default="Reg Start" />

                    </label>
                        <g:datePicker name="regStart" precision="minute"  value="${eventInstance?.regStart}" default="none" noSelection="['': '']" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'regEnd', 'error')} ">
                    <label for="regEnd">
                        <g:message code="event.regEnd.label" default="Reg End" />

                    </label>
                        <g:datePicker name="regEnd" precision="minute"  value="${eventInstance?.regEnd}" default="none" noSelection="['': '']" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'registerOnly', 'error')} ">
                    <label for="registerOnly">
                        <g:message code="event.registerOnly.label" default="Register Only" />

                    </label>
                    <g:select name="registerOnly" from="${eventInstance.constraints.registerOnly.inList}" value="${eventInstance?.registerOnly}" valueMessagePrefix="event.registerOnly" noSelection="['': '']"/>
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'checkIn', 'error')} ">
                    <label for="checkIn">
                        <g:message code="event.checkIn.label" default="Check In" />

                    </label>
                    <g:textField name="checkIn" value="${eventInstance?.checkIn}" size="40" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'checkInStart', 'error')} ">
                    <label for="checkInStart">
                        <g:message code="event.checkInStart.label" default="Check In Start" />

                    </label>
                    <g:datePicker name="checkInStart" precision="minute"  value="${eventInstance?.checkInStart}" default="${new Date()}" noSelection="['': '']" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'checkInEnd', 'error')} ">
                    <label for="checkInEnd">
                        <g:message code="event.checkInEnd.label" default="Check In End" />

                    </label>
                    <g:datePicker name="checkInEnd" precision="minute"  value="${eventInstance?.checkInEnd}" default="${new Date()}" noSelection="['': '']" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'isAudit', 'error')} ">
                    <label for="isAudit">
                        <g:message code="event.isAudit.label" default="Is Audit" />

                    </label>
                    <g:select name="isAudit" from="${eventInstance.constraints.isAudit.inList}" value="${eventInstance?.isAudit}" valueMessagePrefix="event.isAudit" noSelection="['N': 'N']"/>
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'isFood', 'error')} ">
                    <label for="isFood">
                        <g:message code="event.isFood.label" default="Is Food" />

                    </label>
                    <g:select name="isFood" from="${eventInstance.constraints.isFood.inList}" value="${eventInstance?.isFood}" valueMessagePrefix="event.isFood" noSelection="['N': 'N']"/>
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'isSleep', 'error')} ">
                    <label for="isSleep">
                        <g:message code="event.isSleep.label" default="Is Sleep" />

                    </label>
                    <g:select name="isSleep" from="${eventInstance.constraints.isSleep.inList}" value="${eventInstance?.isSleep}" valueMessagePrefix="event.isSleep" noSelection="['N': 'N']"/>
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'isCancel', 'error')} ">
                    <label for="isCancel">
                        <g:message code="event.isCancel.label" default="Is Cancel" />

                    </label>
                    <g:select name="isCancel" from="${eventInstance.constraints.isCancel.inList}" value="${eventInstance?.isCancel}" valueMessagePrefix="event.isCancel" noSelection="['N': 'N']"/>
                </div>

            </div>
        </div>
    </div>
    <div class="panel panel-default">
        <div class="panel-heading">
            <h4 class="panel-title">
                <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">公務人員認證資訊</a>
            </h4>
        </div>
        <div id="collapseTwo" class="panel-collapse collapse">
            <div class="panel-body">

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'certiScore', 'error')} ">
                    <label for="certiScore">
                        <g:message code="event.certiScore.label" default="Certi Score" />

                    </label>
                    <g:textField name="certiScore" value="${eventInstance?.certiScore}" size="40" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'schalarScore', 'error')} ">
                    <label for="schalarScore">
                        <g:message code="event.schalarScore.label" default="Schalar Score" />

                    </label>
                    <g:textField name="schalarScore" value="${eventInstance?.schalarScore}" size="40" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'unit', 'error')} ">
                    <label for="unit">
                        <g:message code="event.unit.label" default="Unit" />

                    </label>
                    <g:textField name="unit" value="${eventInstance?.unit}" size="40" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'courseCode', 'error')} ">
                    <label for="courseCode">
                        <g:message code="event.courseCode.label" default="Course Code" />

                    </label>
                    <g:textField name="courseCode" value="${eventInstance?.courseCode}" size="40" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'virtualHour', 'error')} ">
                    <label for="virtualHour">
                        <g:message code="event.virtualHour.label" default="Virtual Hour" />

                    </label>
                    <g:field name="virtualHour" type="number" value="${eventInstance.virtualHour}"/>
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'realHour', 'error')} ">
                    <label for="realHour">
                        <g:message code="event.realHour.label" default="Real Hour" />

                    </label>
                    <g:field name="realHour" type="number" value="${eventInstance.realHour}"/>
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'county', 'error')} ">
                    <label for="county">
                        <g:message code="event.county.label" default="County" />

                    </label>
                    <g:textField name="county" value="${eventInstance?.county}" size="40" />
                </div>

                <div class="fieldcontain ${hasErrors(bean: eventInstance, field: 'studyType', 'error')} ">
                    <label for="studyType">
                        <g:message code="event.studyType.label" default="Study Type" />

                    </label>
                    <g:textField name="studyType" value="${eventInstance?.studyType}" size="40" />
                </div>

            </div>
        </div>
    </div>
</div>